<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>员工管理</title>
    <#include "../common/link.ftl">
    <script>
        // $(function () {
        //     $("#submitBtn").click(function () {
        //         $("#editForm").ajaxSubmit(function (data) {
        //             console.log(data);
        //             if(data.success){ //用alert或者popup都可以
        //                 $.messager.alert("温馨提示","保存成功!2s后自动关闭")
        //                 window.setTimeout(function () {
        //                     window.location.href = "/courseorder/list.do";
        //                 },2000)
        //             }else{
        //                 $.messager.popup(data.msg)
        //             }
        //         })
        //     })
        //
        // });
    </script>

</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../common/navbar.ftl">
    <!--菜单回显-->
    <#assign currentMenu="employee"/>
    <#include "../common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>课程订单编辑</h1>
        </section>
        <section class="content">
            <div class="box">
                <form class="form-horizontal" action="/courseorder/saveOrUpdate.do" method="post" id="editForm">
                    <input type="hidden" value="${(course.id)!}" name="id" >
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="customer" class="col-sm-2 control-label">姓名：</label>
                        <div class="col-sm-6">
                            <select class="form-control" id="customer" name="customer.id">
                                <#list customers as c>
                                    <option value="${c.id}">${c.name}</option>
                                </#list>
                            </select>
                            <script>
                                $("#customer").val(${(course.customer.id)!})
                            </script>
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="inputTime" class="col-sm-2 control-label">时间：</label>
                        <div class="col-sm-6">
                            <input type="text" class="input-sm form-control" name="inputTime" id="inputTime"
                                   value="${(course.inputTime?string('yyyy-MM-dd'))!}" />
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="systemDictionaryItem" class="col-sm-2 control-label">课程：</label>
                        <div class="col-sm-6">
                            <select class="form-control" id="systemDictionaryItem" name="systemDictionaryItem.id">
                                <#list systemDictionaryItems as s>
                                    <option value="${s.id}">${s.title}</option>
                                </#list>
                            </select>
                            <script>
                                $("#systemDictionaryItem").val(${(course.systemDictionaryItem.id)!})
                            </script>
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="money" class="col-sm-2 control-label">价钱：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control"
                                   id="money" name="money" value="${(course.money)!}">
                        </div>
                    </div>
                    <a href="/courseorder/list.do">
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-6">
                            <!--button如果是在form表单内部,不写type默认就是submit-->
                            <!-- 验证插件只支持submit按钮提交-->
                            <button id="submitBtn" type="submit" class="btn btn-primary">保存</button>
                            <button type="reset" class="btn btn-danger">重置</button>
                        </div>
                    </div>
                    </a>
                </form>
            </div>
        </section>
    </div>
    <#include "../common/footer.ftl">
</div>
</body>
</html>
